
#include "member_BNode.h"
#include "member_BShape.h"

using namespace BWE;

#define n_member(node)			((member_BNode*)node->_ptr)

member_BNode::member_BNode(BNode* node)
{
	boss = node;
	visible = true;
	dirtySpace = true;
}
member_BNode::~member_BNode()
{

}

void member_BNode::update(const BEvent& event)
{
	boss->update(event);
	for (int i = 0; i < shapeItems.size(); i++)
	{
		BShape* shape = shapeItems[i].shape;
		if (shape_member(shape)->dirty)
		{
			shape->flush();
		}
	}
	if (dirtySpace)
	{
		boss->space();
	}
}
void member_BNode::render(BRender& render)
{
	boss->render(render);
}

void member_BNode::procShapeSpaceChanged(BObject* object, const BValue& value)
{
	dirtySpace = true;
}
